<?php


namespace app\common\controller;


/**
 * Class AjaxAdminBase
 * @package app\common\controller
 * AJAX 请求基类，只验证是否登录，不在验证权限
 */
class AjaxAdminBase extends Base
{

    public function initialize()
    {
        $this->limit = intval(input('post.limit/d')) ? intval(input('post.limit/d')) : 25;
        $this->page = intval(input('post.page/d')) ? intval(input('post.page/d')) : 1;

        if ($this->request->isGet()) {
            $this->limit = intval(input('get.limit/d')) ? intval(input('get.limit/d')) : 25;
            $this->page = intval(input('get.page/d')) ? intval(input('get.page/d')) : 1;
        }


        parent::initialize(); // TODO: Change the autogenerated stub
        if (!session('?admin.id')) {
            $this->redirect(url("login/index"));
        }
    }
}